home *** CD-ROM | disk | FTP | other *** search
/ Internet Surfer 2.0 / Internet Surfer 2.0 (Wayzata Technology) (1996).iso / pc / text / mac / faqs.125 < prev    next >
Text File  |  1996-02-12  |  29KB  |  682 lines

  1. Frequently Asked Questions (FAQS);faqs.125
  2.  
  3.  
  4.  
  5. The default value for these resources are set to CopyFromParent.  This
  6. is interpreted as the DefaultColormapOfScreen(), DefaultDepthOfScreen()
  7. and the default visual of the screen if the widget has no parent -- i.e.
  8. it is an applicationShellWidgetClass and the root of your widget tree.
  9.  
  10. If the parent of the widget is not null, then the shell copies
  11. colormap and depth from its parent and uses CopyFromParent as the
  12. visual.
  13.  
  14. ----------------------------------------------------------------------
  15. 8.  I've done all the above and I still get a BadMatch error.  Why?
  16. ----------------------------------------------------------------------
  17.  
  18. Some resource converters improperly cache references.  This was
  19. especially true of X11R3 and earlier versions of Motif.
  20.  
  21. ----------------------------------------------------------------------
  22. 9.  Why doesn't my widget get destroyed when I call XtDestroyWidget()?
  23. ----------------------------------------------------------------------
  24.  
  25. See section 2.8 of the Xt specification.
  26.  
  27. It eventually does get destroyed, just not immediately.  The
  28. Intrinsics destroy a widget in a two-phase process.  First it and all
  29. of its children have a flag set that indicate it is being destroyed.
  30. It is then put on a list of widgets to be destroyed.  This way any
  31. pending X events or further references to that widget can be cleaned
  32. up before the memory is actually freed.  The second phase is then
  33. performed after all callbacks, event handlers, and actions have
  34. completed, before checking for the next X event.  At this point the
  35. list is traversed and each widget's memory is actually free()'d, among
  36. other things.
  37.  
  38. As some further caveats/trivia, the widgets may be destroyed if the
  39. Intrinsics determine that they have no further references to the
  40. widgets on the list.  If so, then the phase 2 destruction occurs
  41. immediately.  Also, if nested event loops are used, widgets placed on
  42. the destroy list before entering the inner event loop are not
  43. destroyed until returning to the outer event loop.
  44.  
  45. ----------------------------------------------------------------------
  46. 10. How do I exit but still execute the DestroyCallbacks?
  47. ----------------------------------------------------------------------
  48.  
  49. The problem is if a simple and entirely reasonable approach to exiting
  50. an application is used, such as calling exit() directly, then a widget
  51. may not have a chance to clean up any external state -- such as open
  52. sockets, temporary files, allocated X resources, etc.  (this code for
  53. simplicity reasons assumes only a single toplevel widget):
  54.  
  55.  
  56.     Widget
  57.     ToplevelGet (gw)
  58.         Widget        gw;        /* widget to find toplevel */
  59.     {
  60.         Widget        top;
  61.  
  62.         for (top = gw; XtParent (top); top = XtParent (top))
  63.             /* empty */;
  64.         return (top);
  65.     }
  66.  
  67.     void
  68.     ExitCallback (gw, closure, call_data)
  69.         Widget        gw;        /* widget */
  70.         XtPointer    closure;    /* data the app specified */
  71.         XtPointer    call_data;    /* widget specific data */
  72.     {
  73.         Widget        toplevel;
  74.  
  75.         toplevel = ToplevelGet (gw);
  76.         XtUnmapWidget (toplevel);    /* make it disappear quickly */
  77.         XtDestroyWidget (toplevel);
  78.         exit (0);
  79.     }
  80.  
  81. One can see that the above code exit's immediately after destroying
  82. the toplevel widget.  The trouble is the phase 2 destruction may never
  83. occur.
  84.  
  85. This works for most widgets and most applications but will not work
  86. for those widgets that have any external state.  You might think that
  87. since it works now it will always work but remember that part of the
  88. reason an object oriented approach is used is so one can be ignorant
  89. of the implementation details for each widget.  Which means that the
  90. widget may change and someday require that some external state is
  91. cleaned up by the Destroy callbacks.
  92.  
  93. One alternative is to modify ExitCallback() to set a global flag and
  94. then test for that flag in a private event loop.  However, private
  95. event loops are frowned upon because it tends to encourage sloppy, and
  96. difficult to maintain practices.
  97.  
  98. Try the following code instead.
  99.  
  100.     #include <X11/Intrinsic.h>
  101.  
  102.     extern Widget ToplevelGet (
  103.     #if NeedFunctionPrototypes
  104.         Widget        gw
  105.     #endif
  106.     );
  107.  
  108.     extern Boolean ExitWorkProc (
  109.     #if NeedFunctionPrototypes
  110.         XtPointer    closure
  111.     #endif
  112.     );
  113.  
  114.     extern void ExitCallback (
  115.     #if NeedFunctionPrototypes
  116.         Widget        gw,
  117.         XtPointer    closure,
  118.         XtPointer    call_data
  119.     #endif
  120.     );
  121.  
  122.     Widget
  123.     ToplevelGet (gw)
  124.     Widget        gw;        /* widget to find toplevel */
  125.     {
  126.         Widget        top;
  127.  
  128.         for (top = gw; XtParent (top); top = XtParent (top))
  129.             /* empty */;
  130.         return (top);
  131.     }
  132.  
  133.  
  134.     void
  135.     ExitCallback (gw, closure, call_data)
  136.     Widget        gw;        /* widget */
  137.     XtPointer    closure;    /* data the app specified */
  138.     XtPointer    call_data;    /* widget specific data */
  139.     {
  140.         Widget        toplevel;
  141.  
  142.         toplevel = ToplevelGet (gw);
  143.         XtUnmapWidget (toplevel);    /* make it disappear quickly */
  144.         XtDestroyWidget (toplevel);
  145.         XtAppAddWorkProc (XtWidgetToApplicationContext (gw),
  146.                   ExitWorkProc, (XtPointer) NULL);
  147.     }
  148.  
  149.     Boolean
  150.     ExitWorkProc (closure)
  151.         XtPointer    closure;
  152.     {
  153.         exit (0);
  154.         /*NOTREACHED*/
  155.     }
  156.  
  157.  
  158. ExitCallback() adds a work procedure that will get called when the
  159. application is next idle -- which happens after all the events are
  160. processed and the destroy callbacks are executed.
  161.  
  162. ----------------------------------------------------------------------
  163. 11. How do I resize a Shell widget?
  164. ----------------------------------------------------------------------
  165.  
  166. After it is realized, one doesn't resize a Shell widget.  The proper
  167. thing is to resize the currently managed child of the Shell widget
  168. using XtSetValues().  The geometry change is then propagated to the
  169. Shell which asks the window manager which may or may not allow the
  170. request.  However, the Shell must have the resource
  171. XtNallowShellResize set to True otherwise it will not even ask the
  172. window manager to grant the request and the Shell will not resize.
  173.  
  174. To change the position of a Shell, use XtSetValues() on the Shell, not
  175. the child, and within the limits of the window manager it should be granted.
  176.  
  177. ----------------------------------------------------------------------
  178. 12. Why can't XtAppAddInput() handle files?
  179. ----------------------------------------------------------------------
  180.  
  181. It does, however Unix semantics for when I/O is ready for a file does
  182. not fit most peoples' intuitive model.  In Unix terms a file
  183. descriptor is ready for reading whenever the read() call would not
  184. block, ignoring the setting of optional flags that indicate not to
  185. block.  This works as expected for terminals, sockets and pipes.  For
  186. a file the read() will always return but the return indicates an EOF
  187. -- i.e. no more data.  The result is the code in the Intrinsics always
  188. calls the input handler because it always thinks something is about to
  189. be read.  The culprit is the select() system call or on SYSV based
  190. OS's it is the poll() system call.
  191.  
  192. How to get around this on a Unix system?  The best approach is to use
  193. another process to check for available input on the file.  Use a pipe
  194. to connect the application with this other process and pass the file
  195. descriptor from the pipe to XtAppAddInput().  A suitable program on
  196. BSD systems is "tail -f filename".
  197.  
  198. It's rumored that select() on some systems is not _completely_
  199. reliable.  In particular:
  200.  
  201.     - IBM AIX 3.1: this is one where it would work for a while
  202.       (several thousand times) and then stop until some other
  203.       event woke it up. This seemed to be the result of a race
  204.       condition in the Kernel.  IBM claims to have a fix for this.
  205.  
  206.     - Pyramid, doesn't work at all.
  207.  
  208.     - Ultrix (and possibly others where pipes are implemented as
  209.       sockets), wasn't completely broken, but although the writing
  210.       side wrote in 512 byte blocks the reading side received it
  211.       all broken up as if it was being put into the pipe a byte at
  212.       a time.  You can waste a lot of time by reading small blocks
  213.       (get raound it by detecting the situation and having
  214.       select() ignore the pipe for 10 mseconds - by then it had
  215.       been given the whole block).
  216.  
  217.  
  218. Note that all the above descriptions used Unix terminology such as
  219. read(), file descriptor, pipes, etc.  This is an OS dependent area and
  220. may not be identical on all systems.  However the Intrinsic designers
  221. felt it was a common enough operation that it should be included with
  222. part of the toolkit.  Why they didn't also deal with signals at this
  223. point I don't know.
  224.  
  225. ----------------------------------------------------------------------
  226. 13. What good books and magazines are there on Xt?
  227. ----------------------------------------------------------------------
  228.  
  229. I have a favorite that is the definitive reference.  To my perspective
  230. it offers a reasonable introduction but also goes into the full
  231. details of the Intrinsics.  When I started using it I was already
  232. familiar with Xt and the concepts behind it, so newcomers may or may
  233. not find it useful.  I've always found it accurate and complete, which
  234. means its a 1000 pages.
  235.  
  236. Asente, Paul J., and Swick, Ralph R., "X Window System Toolkit, The
  237.     Complete Programmer's Guide and Specification", Digital Press,
  238.     1990, ISBN 1-55558-051-3, order number EY-E757E-DP; and by
  239.     Prentice-Hall, ISBN 0-13-972191-6. Also available through DEC
  240.     Direct at 1-800-DIGITAL.
  241.  
  242. The other book I commonly recomend to novices is:
  243.  
  244. Young, Doug. "The X Window System: Applications and Programming with
  245.     Xt (Motif Version)," Prentice Hall, 1989 (ISBN 0-13-497074-8).
  246.     (ISBN 0-13-972167-3)
  247.  
  248. And of course O'Reilly has an entire series of manuals on X and Xt.
  249. O'Reilly ordering is 800-998-9938.  In particular, Volume 5 is an Xt
  250. reference done in manual page style.  The 3rd edition is extensively
  251. overhauled and goes far beyond the MIT manual pages.  I'm finding it
  252. very useful.  In particular, the permutted index and references to
  253. other manual pages help a great deal in chasing down related
  254. information.
  255.  
  256. I read two periodicals, "The X Resource" and the "The X Journal".
  257. These are the only two dealing specifically with X.  "The X Resource"
  258. is published quarterly, by O'Reilly, with one of the issues being the
  259. MIT X Consortium Technical Conference Proceedings.  There is no
  260. advertising.  I've found it informative with pretty good depth.  For
  261. orders, call 1-800-998-9938, or email cathyr@ora.com.  For editorial
  262. matters, email adrian@ora.com.  Table of contents are posted at
  263. math.utah.edu in ~ftp/pub/tex/bib in TeX form and on ftp.uu.net in
  264. ~ftp/published/oreilly/xresource in ASCII form.
  265.  
  266.  
  267. "The X Journal" is a bimonthly trade rag with lots of advertising.
  268. The articles are informative and oriented toward a less technical
  269. audience.  I read it more to see what's going on then with an
  270. expectation of learning a great deal (but remember, I represent a
  271. fairly small percentage of people).  Also, they have a pretty good
  272. collection of people on the advisory board and as columnists.  Call
  273. (908) 563-9033.
  274.  
  275. ----------------------------------------------------------------------
  276. 14. What Widgets are available?
  277. ----------------------------------------------------------------------
  278.  
  279. There are three popular widget sets:
  280.  
  281. Athena    - The set provided with X11.  This is sufficient for most
  282.       purposes but is on the ugly side.  Recently, a 3d look is
  283.       available for ftp on export.lcs.mit.edu:/contrib/Xaw3d.tar.Z.
  284. Motif    - From OSF available for a license fee and commonly shipped on
  285.       many workstation vendors platforms (almost everyone but
  286.       Sun).  It looks good and works well but personally I think
  287.       it is poorly implemented.
  288. OLIT    - The Open Look Intrinsics Toolkit is a set of widgets
  289.       implementing Sun's Open Look specification.  Developed by
  290.       AT&T.  I've never used it so can't comment on its quality.
  291.       I've heard rumours that it is a pain to actually get.
  292.  
  293. In addition the following collection of widgets are also available:
  294.  
  295. Xtra    - a library of widgets for sale from Graphical Software
  296.       Technology (310-328-9338).  It includes bar graph, stacked
  297.       bar graph, line graph, pie chart, xy plot, hypertext, help,
  298.       spreadsheet, and data entry form widgets.  I've never seen
  299.       them so I can't comment.
  300. FWF    - The Free Widget Foundation is attempting to collect a set of
  301.       freely available widgets.  Included are a Pixmap editor,
  302.       FileDialog, and a few others.  The current set of widgets
  303.       can be obtained via anonymous ftp from the machine
  304.       a.cs.uiuc.edu (128.174.252.1) in the file pub/fwf.shar.Z.
  305. Xcu    - The Cornell University widgets from Gene Dykes.  One of the
  306.       early widget sets released.  Provides a nice appearance for
  307.       buttons and has a mini command language.  Probably not so
  308.       widely used.
  309. Xs    - The Sony widget set.  This was around during R3 days but
  310.       seemed to disappear.  It looked like it had promise.
  311. Xw    - The HP widgets.  The precursor to Motif.  Originally written
  312.       for R3 there exists diffs to get it to work under R4 & R5.
  313.       Again, a pretty good widget set but has more or less died.
  314.       The precursor to this was the Xray toolkit which was
  315.       originally implemented for X10R4 and apparently provided
  316.       much experience for the designers of Xt.
  317. Xo    - A widget set I'm working on.  It's still primitive but you
  318.       can give it a try in archive.cis.ohio-state.edu:pub/Xo/*
  319.  
  320. The following specialized widgets are also available:
  321.  
  322. Tbl    - Implements a tabular layout of widgets.  Supports Motif
  323.       widgets as children.  Part of Wcl.
  324. Plots    - The Athena Plotting widgets (not the Athena widgets).
  325.       Contact gnb@bby.oz.au or joe@Athena.MIT.EDU.
  326.  
  327. ----------------------------------------------------------------------
  328. 15. What alternatives to the Intrinsics are there?
  329. ----------------------------------------------------------------------
  330.  
  331.     __________________________________________
  332.     Name        Language    Vendor
  333.     __________________________________________
  334.     Xview        C        Sun
  335.     OI        C++        ParcPlace
  336.     Interviews    C++        Stanford
  337.     __________________________________________
  338.  
  339.  
  340. However much I like C and admire the skill in both designing and
  341. implementing the Intrinsics, hopefully some alternative will develop
  342. in the next 3-5 years that uses an object oriented language.  Keep
  343. your eyes open and expect some change about the same time a language
  344. other than C _starts_ gaining acceptance.
  345.  
  346. ----------------------------------------------------------------------
  347. 16. How do I pass a float value to XtSetValues?
  348. ----------------------------------------------------------------------
  349.  
  350. First, what is going wrong is the structure for an Arg is (essentially)
  351.     typdef struct
  352.     {    
  353.         String    name;
  354.         long    value;
  355.     } Arg;
  356.  
  357. and the code:
  358.     Arg    arg;
  359.  
  360.     XtSetArg (arg, "name", 3.2)
  361.  
  362. expands to
  363.     Arg    arg;
  364.  
  365.     arg.name = "name";
  366.     arg.value = 3.2;
  367.  
  368. you can see that with normal C type conversions, the arg.value
  369. gets the integer "3" instead of the floating point value "3.2".  When
  370. the value is copied into the widget resource, the bit pattern is
  371. wildly different than that required for a floating point value.  So,
  372. how to get around this?
  373.  
  374. The following macro is from the Athena widgets document and I am now
  375. recomending it over the previous suggestions.
  376.  
  377. #define XtSetFloatArg(arg, n, d) \
  378.     if (sizeof(float) > sizeof(XtArgVal)) { \
  379.         XtSetArg(arg, n, &(d)); \
  380.     } else { \
  381.         XtArgVal *ld = (XtArgVal *)&(d); \
  382.         XtSetArg(arg, n, *ld); \
  383.     }
  384.  
  385.  
  386. ----------------------------------------------------------------------
  387. 17. +++How do I write a resource converter?
  388. ----------------------------------------------------------------------
  389.  
  390. See section 9.6 of the Xt specification, and/or, start with a
  391. previously written resource converter, and modify it.
  392.  
  393. ----------------------------------------------------------------------
  394. 18. How do I open multiple displays?
  395. ----------------------------------------------------------------------
  396.  
  397. See "Multi-user Application Software Using Xt", The X Resource, Issue 3,
  398. (Summer 1992) by Oliver Jones for a complete coverage of the issues
  399. involved.  Most of this answer is based on that article.  In a
  400. nutshell, one uses XtOpenDisplay() to add each display to a _single_
  401. application context and then XtCloseDisplay() to shutdown each display
  402. and remove it from the application context.
  403.  
  404. The real problems occur when trying to close down a display.  This can
  405. happen 3 ways:
  406.     1. User selects a "quit" button on one of the displays,
  407.     2. User has window manager send a WM_DELETE_WINDOW message,
  408.     3. Server disconnect -- possibly from a KillClient message,
  409.        server shutdown/crash, or network failure.
  410.  
  411. I'll assume you can deal gracefully with 1 & 2 since it is _merely_ a
  412. problem of translating a Widget to a display and removing that
  413. display.  If not, then read the Oliver Jones article.
  414.  
  415. The third one is difficult to handle.  The following is based on the
  416. Oliver Jones article and I include it here because it is a difficult
  417. problem.
  418.  
  419. The difficulty arises because the Xlib design presumed that an I/O
  420. error is always unrecoverable and so fatal.  This is essentially true
  421. for a single display X based application, but not true for a
  422. multiple display program or an application that does things other than
  423. display information on an X server.  When an X I/O error occurs the
  424. I/O error handler is called and _if_ it returns then an exit()
  425. happens.  The only way around this is to use setjmp/longjmp to avoid
  426. returning to the I/O error handler.  The following code fragment
  427. demonstrates this:
  428.  
  429. #include <setjmp.h>
  430. jmp_buf XIOrecover;
  431.  
  432. void
  433. XIOHandler (dpy)
  434.     Display        *dpy;
  435. {
  436.     destroyDisplay (dpy);
  437.     longjmp (XIOrecover, 1);
  438. }
  439.  
  440. main ()
  441. {
  442.     ...
  443.     if (setjmp (XIOrecover) == 0)
  444.         XSetIOErrorHandler (XIOHandler);
  445.     XtAppMainLoop (app_context);
  446. }
  447.  
  448. The destroyDisplay() is something that given a Display pointer can go
  449. back to the application specific data and perform any necessary
  450. cleanup.  It should also call XtCloseDisplay().
  451.  
  452. For those of you unfamiliar with setjmp/longjmp, when setjmp() is
  453. first called it returns a 0 and save's enough information in the
  454. jmp_buf that a latter execution of longjmp() can return the program to
  455. the same state as if the setjmp() was just executed.  The return value
  456. of this second setjmp() is the value of the second argument to
  457. longjmp().  There are several caveats about using these but for this
  458. purpose it is adequate.
  459.  
  460. Some other problems you might run into are resource converters that
  461. improperly cache resources.  The most likely symptoms are Xlib errors
  462. such as BadColor, BadAtom, or BadFont.  There may be problems with the
  463. total number of displays you can open since typically only a limited
  464. number of file descriptors are available with 32 being a typical
  465. value.  You may also run into authorization problems when trying to
  466. connect to a display.
  467.  
  468. There was much discussion in comp.windows.x about this topic in
  469. November of 91.  Robert Scheifler posted an article which basically
  470. said this is the way it will be and Xlib will not change.
  471.  
  472. ----------------------------------------------------------------------
  473. 19. What changed from R3 to R4 to R5?
  474. ----------------------------------------------------------------------
  475.  
  476. This addresses only changes in the Intrinsics.  First, the general
  477. changes for each release are described.  Then a, certainly incomplete,
  478. list of new functions added and others that are now deprecated are
  479. listed.  Brevity is a primary goal.
  480.  
  481. Much of the following information is retrieved from Chapter 13 of the MIT
  482. Xt Intrinsics Manual and from O'Reilly Volume 5, 3rd edition.
  483.  
  484. From R3 to R4
  485. - Addition of gadgets (windowless widgets)
  486. - New resource type converter interface to handle cacheing and
  487.   additional  data.
  488. - Variable argument list interface.
  489. - #define XtSpecificationRelease 4  (added with this release)
  490. - WMShellPart, TopLevelShellPart & TransientShellPart changed
  491.   incompatibly.
  492. - core.initialize, core.set_values added ArgList and count parameters
  493. - event handlers had continue_to_dispatch parameter added
  494. - core.set_values_almost specification changed.
  495. - core.compress_exposure changed to an enumerated data type from Boolean
  496. - core.class_inited changed to enumerated data type from Boolean
  497. - constraint.get_values_hook added to extension record
  498. - core.initialize_hook obsolete as info is passed to core.initialize
  499. - shell.root_geometry_manager added to extension record
  500. - core.set_values_hook obsolete as info is passed to core.set_values
  501. - Calling XtQueryGeometry() must store complete geometry.
  502. - Added UnrealizeCallback.
  503. - XtTranslateCoords() actually works under R4.
  504.  
  505. From R4 to R5:
  506. - Psuedo resource baseTranslation added.
  507. - Searching for app-default, and other files, made more flexible
  508. - customization resource added.
  509. - Per-screen resource database.
  510. - Support permanently allocated strings.
  511. - Permanetly allocated strings required for several class fields.
  512. - The args argument to XtAppInitialize, XtVaAppInitialize,
  513.   XtOpenDisplay, XtDisplayInitialize, and XtInitialize were changed
  514.   from Cardinal* to int*
  515. - Many performance improvements (this is summarized from the article
  516.   "Xt Performance Improvements in Release 5" by Gabe Beged-Dov in "The
  517.   X Resource", Issue 3):
  518.     - XrmStringToQuark() augmented with XrmPermStringToQuark() to
  519.       avoid string copies.  Several fields in the class record are
  520.       indicated as needing permanent strings.
  521.     - Using an array of Strings for resources
  522.     - Callback lists redesigned to use less memory
  523.     - Translation manager redesigned and rewritten so it takes
  524.       less memory, translation tables merges are faster, cache of
  525.       action bindings
  526.     - Keycode to Keysyms are cached.
  527.     - Better sharing of GC's with modifiable fields
  528.     - Window to Widget translation uses less space and faster
  529.     - Does not malloc space for widget name since quark is available
  530.     - Widget space is allocated to include the constraints
  531.     - Over several example programs, about a 26% reduction in
  532.       memory usage.
  533.  
  534. Functions new with R5:
  535. ----------------------
  536. XtAllocateGC()        - sharable GC with modifiable fields
  537. XtGetActionList()    - get the action table of a class
  538. XtScreenDatabase()    - return resource database for a screen
  539. XtSetLanguageProc()    - register language procedure called to set locale
  540.  
  541.  
  542. Functions new with R4:
  543. ----------------------
  544. XtAppAddActionHook()    - procedure to call before _every_ action.
  545. XtAppInitialize()    - lots of initialization work.
  546. XtAppReleaseCacheRefs()    - decrement cache reference count for converter
  547. XtAppSetFallbackResources() - specify default resources
  548. XtAppSetTypeConverter()    - register a new style converter
  549. XtCallCallbackList()    - directly execute a callback list
  550. XtCallConverter    ()    - invoke a new style converter
  551. XtCallbackReleaseCacheRef() - release a cached resource value
  552. XtCallbackReleaseCacheRefList() - release a list of cached resource values
  553. XtConvertAndStore()    - find and call a resource converter
  554. XtDirectConvert()    - Invoke old-style converter
  555. XtDisplayOfObject()    - Return the display
  556. XtDisplayStringConversionWarning() - issue a warning about conversion
  557. XtFindFile()        - Find a file
  558. XtGetActionKeysym()    - Retrieve keysym & modifies for this action
  559. XtGetApplicationNameAndClass() - return name and class
  560. XtGetConstraintResourceList() - get constraints for a widget
  561. XtGetKeysymTable()    - return keycode-to-keysym mapping table
  562. XtGetMultiClickTime()    - read the multi-click time
  563. XtGetSelectionRequest()    - retrieve the SelectionRequest event
  564. XtGetSelectionValueIncremental() - obtain the selection value incrementally
  565. XtGetSelectionValuesIncremental() - obtain the selection value incrementally
  566. XtInitializeWidgetClass() - initialize a widget class manually
  567. XtInsertEventHanlder()    - register event handler before/after others
  568. XtInsertRawEventHandler() - register event handler without modify input mask
  569. XtIsObject()        - test if subclass of Object
  570. XtIsRectObj()        - test if subclass of RectObj
  571. XtKeysymToKeyCodeList()    - return list of keycodes
  572. XtLastTimestampProcessed() - retrieve most recent event time
  573. XtMenuPopdown        - Action for popping down a widget
  574. XtMenuPopup        - Action for popping up a widget
  575. XtOffsetOf        - macro for structure offsets
  576. XtOwnSelectionIncremental() - make selection data availabe incrementally
  577. XtPoupSpringLoaded()    - map a spring-loaded popup
  578. XtRegisterGrabAction()    - indicate action procedure needs a passive grab
  579. XtRemoveActiohHook()    - remove function called after every action
  580. XtResolvePathname()    - find a file
  581. XtScreenOfObject()    - return screen of object.
  582. XtSetMultiClickTime()    - set the multi-click time
  583. XtSetWMColormapWindows() - set WM_COLORMAP_WINDOWS for custom colormaps
  584. XtUngrabButton()    - cancel a passive button grab
  585. XtUngrabKey()        - cancel a passive key grab
  586. XtUngrabKeybard()    - release an active keyboard grab
  587. XtUngrabPointer()    - release an active pointer grab
  588. XtVa*()            - varags interfaces to a bunch of functions
  589. XtWindowOfObject()    - return Window of nearest widget ancestor
  590.  
  591.  
  592. Deprecated        Replacement            When
  593. ----------------------------------------------------------------------
  594. XtAddActions()        XtAppAddActions()        R3
  595. XtAddConverter()    XtAppAddConverter()        R3
  596. XtAddInput()        XtAppAddInput ()        R3
  597. XtAddTimeout()        XtAppAddTimeout()        R3
  598. XtAddWorkProc()        XtAppAddWorkProc()        R3
  599. XtConvert()        XtConvertAndStore()        R4
  600. XtCreateApplicationShell XtAppCreateShell()        R3
  601. XtDestroyGC()        XtReleaseGC()            R3
  602. XtError()        XtAppError()            R3
  603. XtGetErrorDatabase()    XtAppGetErrorDatabase        R3
  604. XtGetErrorDatabaseText() XtAppGetErrorDatabaseText    R3
  605. XtGetSelectionTimeout()    XtAppGetSelectionTimeout    R3
  606. XtInitialize()        XtAppInitialize()        R3
  607. XtMainLoop()        XtAppMainLoop()            R3
  608. MenuPopdown(action)    XtMenuPopdown(action)        R4
  609. MenuPopup(action)    XtMenuPopup(action)        R4
  610. XtNextEvent()        XtAppNextEvent()        R3
  611. XtPeekEvent()        XtAppPeekEvent()        R3
  612. XtPending()        XtAppPending()            R3
  613. XtSetErrorHandler()    XtAppSetErrorHandler()        R3
  614. XtSetErrorMsgHandler    XtAppSetErrorMsgHandler()    R3
  615. XtSetSelectionTimeout()    XtAppSetSelectionTimeout()    R3
  616. XtSetWarningHandler()    XtAppSetWarningHandler()    R3
  617. XtSetWarningMsgHandler() XtAppSetWarningMsgHandler()    R3
  618. XtWarning()        XtAppWarning()            R3
  619. XtWarningMsg()        XtAppWarningMsg()        R3
  620.  
  621. ----------------------------------------------------------------------
  622. 20. Where are the resources loaded from?
  623. ----------------------------------------------------------------------
  624.  
  625. The resources of a widget are filled in from the following places
  626. (from highest priority to lowest priority):
  627.  
  628.     1. Args passed at creation time.
  629.     2. Command line arguments.
  630.     3. User's per host defaults file
  631.     4. User's defaults file.
  632.     5. User's per application default file.
  633.     6. System wide per application default file.
  634.  
  635. Note that 2-6 are read only once on application startup.  The result
  636. of steps 3-6 is a single resource database used for further queries.
  637.  
  638. The per host defaults file contains customizations for all
  639. applications executing on a specific computer.  This file is either
  640. specified with the XENVIRONMENT environment variable or if that is not
  641. set then the file $HOME/.Xdefaults-<host> is used.
  642.  
  643. The user defaults file is either obtained from the RESOURCE_MANAGER
  644. property on the root window of the display or if that is not set then
  645. the file $HOME/.Xdefaults is used.  Typically, the program "xrdb" is
  646. used to set the RESOURCE_MANAGER property.  Please note that this
  647. should be kept relatively small as each client that connects to the
  648. display must transfer the property.  A size of around 1-3KByte is
  649. reasonable.  Some toolkits may track changes to the RESOURCE_MANAGER
  650. but most do not.
  651.  
  652. A user may have many per application default files containing
  653. customizations specific to each application.  The intrinsics are quite
  654. flexible on how this file is found.  Read the next part that describes
  655. the various environment variables and how they effect where this file
  656. is found.
  657.  
  658. The system wide per application default files are typically found in
  659. /usr/lib/X11/app-defaults.  If such a file is not found then the
  660. fallback resources are used.  The intrinsics are quite flexible on how
  661. this file is found.  Read the next part that describes the various
  662. environment variables and how they effect where this file is found.
  663.  
  664. [Thanks to Oliver Jones (oj@pictel.com) for the following, 6/92]
  665.  
  666. You can use several environment variables to control how resources are
  667. loaded for your Xt-based programs -- XFILESEARCHPATH,
  668. XUSERFILESEARCHPATH, and XAPPLRESDIR.  These environment variables
  669. control where Xt looks for application-defaults files as an
  670. application is initializing.  Xt loads at most one app-defaults file
  671. from the path defined in XFILESEARCHPATH and another from the path
  672. defined in XUSERFILESEARCHPATH.
  673.  
  674. Set XFILESEARCHPATH if software is installed on your system in such a
  675. way that app-defaults files appear in several different directory
  676. hierarchies.  Suppose, for example, that you are running Sun's Open
  677. Windows, and you also have some R4 X applications installed in
  678. /usr/lib/X11/app-defaults. You could set a value like this for
  679. XFILESEARCHPATH, and it would cause Xt to look up app-defaults files
  680. in both /usr/lib/X11 and /usr/openwin/lib (or wherever your
  681. OPENWINHOME is located):
  682.